/** 计划管理 */

/** 生产工单 */
let workOrder = [
  // 工单管理
  {
    path: '/workListReceive',
    name: 'workListReceive',
    component (resolve) {
      require(['../view/planningManage/workListManage/workListReceive/WorkListReceive'], resolve)
    },
    meta: {
      keepAlive: true,
      menuItem: 'workListReceive',
      subMenu: 'workListManage',
      rootDir: 'planningManage',
      title: '工单管理'
    }
  },
  // 工单导入历史
  {
    path: '/importHistory',
    name: 'importHistory',
    component (resolve) {
      require(['../view/planningManage/workListManage/workListReceive/ImportHistory'], resolve)
    },
    meta: {
      keepAlive: true,
      menuItem: 'workListReceive',
      subMenu: 'workListManage',
      rootDir: 'planningManage',
      title: '已导入历史记录'
    }
  },
  // 工单导入详情
  {
    path: '/importDetail/:id',
    name: 'importDetail',
    component (resolve) {
      require(['../view/planningManage/workListManage/workListReceive/ImportDetail'], resolve)
    },
    meta: {
      keepAlive: false,
      menuItem: 'workListReceive',
      subMenu: 'workListManage',
      rootDir: 'planningManage',
      title: '导入详情'
    }
  },
  // 工单表导入预览
  {
    path: '/workOrderPreview/:id',
    name: 'workOrderPreview',
    component (resolve) {
      require(['../view/planningManage/workListManage/workListReceive/WorkOrderPreview'], resolve)
    },
    meta: {
      keepAlive: false,
      menuItem: 'workListReceive',
      subMenu: 'workListManage',
      rootDir: 'planningManage',
      title: '工单表导入预览'
    }
  },
  // 工单信息总览
  {
    path: '/workListInfoDetail',
    name: 'workListInfoDetail',
    component (resolve) {
      require(['../view/planningManage/workListManage/workListReceive/WorkListInfoDetail'], resolve)
    },
    meta: {
      keepAlive: false,
      menuItem: 'workListReceive',
      subMenu: 'workListManage',
      rootDir: 'planningManage',
      title: '工单信息总览'
    }
  },
  // 工单详情
  {
    path: '/workListReceiveDetail/:id',
    name: 'workListReceiveDetail',
    component (resolve) {
      require(['../view/planningManage/workListManage/workListReceive/WorkListReceiveDetail'], resolve)
    },
    meta: {
      keepAlive: false,
      menuItem: 'workListReceive',
      subMenu: 'workListManage',
      rootDir: 'planningManage',
      title: '工单详情'
    }
  },
  // 周计划管理（计划员）
  {
    path: '/planner',
    name: 'planner',
    component (resolve) {
      require(['../view/planningManage/workListManage/planner/Planner'], resolve)
    },
    meta: {
      keepAlive: true,
      menuItem: 'planner',
      subMenu: 'workListManage',
      rootDir: 'planningManage',
      title: '周计划管理-计划员'
    }
  },
  // 周计划管理（审核员）
  {
    path: '/auditor',
    name: 'auditor',
    component (resolve) {
      require(['../view/planningManage/workListManage/auditor/Auditor'], resolve)
    },
    meta: {
      keepAlive: true,
      menuItem: 'auditor',
      subMenu: 'workListManage',
      rootDir: 'planningManage',
      title: '周计划管理-审核员'
    }
  },
  // 任务管理
  {
    path: '/taskManage',
    name: 'taskManage',
    component (resolve) {
      require(['../view/planningManage/workListManage/taskManage/TaskManage'], resolve)
    },
    meta: {
      keepAlive: true,
      menuItem: 'taskManage',
      subMenu: 'workListManage',
      rootDir: 'planningManage',
      title: '任务管理'
    }
  },
]

/** 工单BOM树 */
let planningManage = [
  // 工单BOM树
  {
    path: '/workListBomTree',
    name: 'workListBomTree',
    component (resolve) {
      require(['../view/planningManage/workListBomManage/workListBomTree/WorkListBomTree'], resolve)
    },
    meta: {
      keepAlive: true,
      menuItem: 'workListBomTree',
      subMenu: 'workListBomManage',
      rootDir: 'planningManage',
      title: '工单BOM树'
    }
  },
  // 工单工序管理
  {
    path: '/workSheetProcedureManage',
    name: 'workSheetProcedureManage',
    component (resolve) {
      require(['../view/planningManage/workListBomManage/workSheetProcedureManage/WorkSheetProcedureManage'], resolve)
    },
    meta: {
      keepAlive: true,
      menuItem: 'workSheetProcedureManage',
      subMenu: 'workListBomManage',
      rootDir: 'planningManage',
      title: '工单工序管理'
    }
  },
  // 工单物料管理
  // {
  //   path: '/workSheetMaterialManage',
  //   name: 'workSheetMaterialManage',
  //   component (resolve) {
  //     require(['../view/planningManage/workListBomManage/workSheetMaterialManage/WorkSheetMaterialManage'], resolve)
  //   },
  //   meta: {
  //     keepAlive: true,
  //     menuItem: 'workSheetMaterialManage',
  //     subMenu: 'workListBomManage',
  //     rootDir: 'planningManage',
  //     title: '工单物料管理'
  //   }
  // },
  // 工单物料清单
  // {
  //   path: '/workSheetMaterialList',
  //   name: 'workSheetMaterialList',
  //   component (resolve) {
  //     require(['../view/planningManage/workListBomManage/workSheetMaterialList/WorkSheetMaterialList'], resolve)
  //   },
  //   meta: {
  //     keepAlive: true,
  //     menuItem: 'workSheetMaterialList',
  //     subMenu: 'workListBomManage',
  //     rootDir: 'planningManage',
  //     title: '工单物料清单'
  //   }
  // },
  // 工单工序上料表
  {
    path: '/workSheetProcedureSheet',
    name: 'workSheetProcedureSheet',
    component (resolve) {
      require(['../view/planningManage/workListBomManage/workSheetProcedureSheet/WorkSheetProcedureSheet'], resolve)
    },
    meta: {
      keepAlive: true,
      menuItem: 'workSheetProcedureSheet',
      subMenu: 'workListBomManage',
      rootDir: 'planningManage',
      title: '工单工序上料表'
    }
  },
  // 工单工序资源表
  {
    path: '/workSheetResourceSheet',
    name: 'workSheetResourceSheet',
    component (resolve) {
      require(['../view/planningManage/workListBomManage/workSheetResourceSheet/WorkSheetResourceSheet'], resolve)
    },
    meta: {
      keepAlive: true,
      menuItem: 'workSheetResourceSheet',
      subMenu: 'workListBomManage',
      rootDir: 'planningManage',
      title: '工单工序资源表'
    }
  }
]

export default [...workOrder, ...planningManage]
